package map;

import com.sun.javafx.collections.MappingChange;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

public class mapdemo_2 {
   /*
        map集合遍历的方式
    */


    public static void main(String[] args) {
        Map<String,String> map1=new HashMap<>();
        map1.put("1","1Value");
        map1.put("2","2Value");
        map1.put("3","3Value");
        map1.put("4","4Value");
        for (Map.Entry<String,String> entry:map1.entrySet()){
            System.out.println(entry.getKey()+"="+entry.getValue());
        }
    }
}
